﻿using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;

namespace T.FAS.Runtime.Metadata.Entity.Page
{
    /// <summary>
    /// 视图对象
    /// </summary>
    /// <remarks>
    ///  "ViewModel": [{ "ActionID": "AppCluster_GetDataList","ActionSourceType": 0, //0:DQ,1:DM,2:Action "ActionSourceID": "DQ.ID/DM.ID","DataLoadType": 0 //0:PreLoad、1：LazyLoad，2：OnDemandLoad}]
    /// </remarks>
    [DataContract]
    [Serializable]
    public class PageViewModel :ICloneable
    {
        /// <summary>
        /// 主键
        /// </summary>
        [DataMember(Name = "ID")]
        public string ID { get; set; }
        /// <summary>
        /// PageID
        /// </summary>
        public string PageID { get; set; }
        /// <summary>
        /// 排序
        /// </summary>
        public int ViewModelOrder { get; set; }
        /// <summary>
        /// ActionID
        /// </summary>
        [DataMember]
        public string ActionID { get; set; }
        /// <summary>
        /// ActionCode
        /// </summary>
        [DataMember]
        public string ActionCode { get; set; }
        /// <summary>
        /// TargetID
        /// </summary>
        [DataMember]
        public string TargetID { get; set; }
        /// <summary>
        /// JSScript
        /// </summary>
        [DataMember]
        public string JSScript { get; set; }
        /// <summary>
        /// Action类型
        /// </summary>
        [DataMember]
        public ActionType ActionType { get; set; }
        /// <summary>
        /// 数据加载类型
        /// </summary>
        [DataMember]
        public DataLoadType DataLoadType { get; set; }
        /// <summary>
        /// 参数列表
        /// </summary>
        [DataMember]
        public List<PageActionParameter> Parameters { get; set; } = new List<PageActionParameter>();
        /// <summary>
        /// 返回值类型
        /// </summary>
        [DataMember]
        public string ReturnValueType { get; set; }
        public object Clone()
        {
            return this.MemberwiseClone();
        }
    }
}
